//
//  OrderCell.m
//  Meum
//
//  Created by 黄卫 on 17/2/25.
//  Copyright © 2017年 huangwei. All rights reserved.
//

#import "OrderCell.h"

@interface OrderCell()
@end


@implementation OrderCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self== [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        _iconView = [[UIImageView alloc] init];
        _iconView.frame = CGRectMake(15, 15, 72, 72);
        _iconView.backgroundColor = [UIColor grayColor];
        [self.contentView addSubview:self.iconView];
        
        _titleLab = [[UILabel alloc] init];
        _titleLab.frame = CGRectMake(CGRectGetMaxX(_iconView.frame)+15, 15, 100, 16);
        _titleLab.font = [UIFont systemFontOfSize:16];
        _titleLab.textColor = [UIColor grayColor];
        [self.contentView addSubview:_titleLab];
        
        _detailLab = [[UILabel alloc] init];
        _detailLab.frame = CGRectMake(CGRectGetMaxX(_iconView.frame)+15, CGRectGetMaxY(_titleLab.frame)+15, 100, 16);
        _titleLab.font = [UIFont systemFontOfSize:14];
        _titleLab.textColor = [UIColor lightGrayColor];
        [self.contentView addSubview:_detailLab];
        
        _cancelBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        _cancelBtn.frame = CGRectMake([UIScreen mainScreen].bounds.size.width-15-60, CGRectGetMaxY(_detailLab.frame)+15, 60, 20);
        [_cancelBtn setTitle:@"取消订单" forState:UIControlStateNormal];
        [_cancelBtn setBackgroundColor:[UIColor redColor] forState:UIControlStateNormal];
        _cancelBtn.titleLabel.font = [UIFont systemFontOfSize:12];
        _cancelBtn.titleLabel.textColor = [UIColor blackColor];
        [self.contentView addSubview:_cancelBtn];
        
        _sureBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        _sureBtn.frame = CGRectMake(CGRectGetMinX(self.cancelBtn.frame)-15-60, CGRectGetMaxY(_detailLab.frame)+15, 60, 20);
        [_sureBtn setBackgroundColor:[UIColor greenColor] forState:UIControlStateNormal];
        [_sureBtn setTitle:@"去支付" forState:UIControlStateNormal];
        _sureBtn.titleLabel.font = [UIFont systemFontOfSize:12];
        [self.contentView addSubview:_sureBtn];

        
        
    }
    return self;
}




@end
